<?php
require('includes/application_top.php');
global $db;
$oID = $_POST['orders_id'];

$db->Execute("update ".TABLE_ORDERS." set orders_status=3 where orders_id=".$oID.";");

//insert new comment
$db->Execute("insert into " . TABLE_ORDERS_STATUS_HISTORY . "
		(orders_id, orders_status_id, date_added, customer_notified, comments)
		values ('" . (int)$oID . "',
		'3',
		now(),
		'1',
		'Entregue e facturado')");
		
echo("SUCCESS");
?>
